package day1;

import java.util.*;

/**
 * @author oldliu
 * @since 1.0
 */
public class ArrTest {
    public static void main(String[] args) {
        List list=new ArrayList();
        //保证加入的顺序。。。
        //可重复
        list.add("dog");
        list.add(Math.PI);
        list.add("apple");
        list.add(0,"cat");
        System.out.println(list);

        list.add("elephant");
        Object o = list.get(2);
        System.out.println("第三个元素是："+o);
        System.out.println(">>>>>>>>>>>>>遍历>>>>>>>>>>>>>>>>>>");
        for(int i=0;i<list.size();i++){
            System.out.print(list.get(i)+"\t");
        }
        //contains
        System.out.println();
        System.out.println("大象在不在？"+list.contains("elephant"));
    }
}
